package com.atguigu.cloud.order.feign.retryer;

import feign.RetryableException;
import feign.Retryer;

public class FeignClientRetryer implements Retryer {

    private int start = 1;
    private int end = 1;

    @Override
    public void continueOrPropagate(RetryableException e) {
        if (start >= end) {
            throw new RuntimeException("超过重试次数");
        }
        start++;
    }

    @Override
    public Retryer clone() {
        return new FeignClientRetryer();
    }
}